package com.yuanqi.Controller;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.yuanqi.Common.Pojo.entity.Adsense;
import com.yuanqi.Return.Result;
import com.yuanqi.Service.AdsenseService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/v1/adsense")
public class AdsenseController {
    @Resource
    AdsenseService adsenseService;
    @GetMapping
    public Result getAdsense(String type)
    {
        LambdaQueryWrapper<Adsense> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(Adsense::getType,type);
        List<Adsense> list = adsenseService.list(wrapper);
        return Result.success(list);
    }
}
